<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateKmsDailyTaskNodesProcessor extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kms_task_nodes_processor', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("nodeId")->comment("kms_daily_task_nodes.id")->default(0);
            $table->unsignedTinyInteger("handlerUserType")->comment("节点处理人类型 0 - 指定用户uid")->default(0);
            $table->unsignedBigInteger("handlerUserId")->comment("节点处理人 rms.id")->default(0);
            $table->string("handlerUsername")->comment("节点处理人 姓名")->default("");
            $table->unsignedTinyInteger("status")->comment("处理状态 0 - 待处理 1 - 通过 2 - 驳回")->default(0);
            $table->text("remark")->comment("处理备注");
            $table->json("extra")->comment("额外信息");


            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '任务 - 节点处理人';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kms_task_nodes_processor');
    }
}
